'use strict';
import * as types from '../constants/ActionType';
import { fetchPost, fetchPut, fetchGet, fetchDelete } from '../static/js/httprequest';
import { message } from 'antd';
import { formatUrl } from '../constants/CommonFn';
import { Msg } from '../constants/MsgBox';

const url = 'http://127.0.0.1:8080';
/*
export let GetWeather = () => {
  return dispatch => {
    return fetchGet(URL)
      .then(json => {
        if(json.status === '0000'){
          dispatch(triggerAction(json.data,types.GET_Weather))
        } else {
          Msg.error('出错');
        }
      });
  }
}
*/


export let PostLogin = (info) => {
  return dispatch => {
    return fetchGet('http://localhost:3000/health/fetchdorm')
      .then(json => {
        //debugger
        console.log(json);
        // if(json.status === '0000'){
        //   dispatch(triggerAction(json.data,types.GET_Weather))
        // } else {
        //   Msg.error('出错');
        // }
      });
  }
}

